import 'package:flutter/cupertino.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text('Text Width Example'),
        ),
        body: HomePageWidget(),
      ),
    );
  }
}

class HomePageWidget extends StatefulWidget {
  @override
  State<StatefulWidget> createState() {
    GestureArenaTeam;
    return HomePageWidgetState();
  }

}
class HomePageWidgetState extends State<HomePageWidget> {

  @override
  void initState() {
    super.initState();
  }

//  自定义手势添加 到GestureArenaTeam 并设为captain
  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      behavior: HitTestBehavior.deferToChild,
      onPanCancel: (){
        print("onPanCancel1");
      },

      onPanStart: (DragStartDetails details){
        print("onPanStart1");
      },
      onPanUpdate: (DragUpdateDetails details){
        print("onPanUpdate1");
        details;

      },
      onPanDown: (DragDownDetails details){
        print("onPanDown1");

      },
      onPanEnd: (DragEndDetails details){
        print("onPanEnd1");
      },
      child: Container(
        padding: EdgeInsets.all(100),
        color: Colors.red,
        child: GestureDetector(
          behavior: HitTestBehavior.opaque,
          onScaleEnd: (ScaleEndDetails details){
            print("onScaleEnd");
          },
          onScaleStart: (ScaleStartDetails details){
            print("onScaleStart");
          },
          onScaleUpdate: (ScaleUpdateDetails details){
            print("onScaleUpdate");
          },
          child: Column(
            mainAxisSize: MainAxisSize.min,
            children: [
              Container(
                color: Colors.blue,
                child: Container(
                  height: 200,
                  width: 200,
                  color: Colors.green,
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}

